#include <QString>
#include "PartStore.h"


/*============================================<配件类实现>============================================*/
Part::Part(int id, QString name, QString model, double price, QString location, int stockQuantity, int stockUpperLimit, int stockLowerLimit) :
    id(id), name(name), model(model), price(price), location(location), stockQuantity(stockQuantity), stockUpperLimit(stockUpperLimit), stockLowerLimit(stockLowerLimit) {}
Part::Part(QString name, QString model, double price, QString location, int stockQuantity, int stockUpperLimit, int stockLowerLimit) :
    name(name), model(model), price(price), location(location), stockQuantity(stockQuantity), stockUpperLimit(stockUpperLimit), stockLowerLimit(stockLowerLimit) {}
Part::~Part() {}

int Part::getId()const { return this->id; }
QString Part::getName()const { return this->name; }
QString Part::getModel()const { return this->model; }
double Part::getPrice()const { return this->price; }
QString Part::getLocation()const { return this->location; }
int Part::getStockQuantity()const { return this->stockQuantity; }
int Part::getStockUpperLimit()const { return this->stockUpperLimit; }
int Part::getStockLowerLimit()const { return this->stockLowerLimit; }

void Part::setLocation(QString location) {this->location = location;}
void Part::setStockQuantity(int quantity) { this->stockQuantity = quantity; }



/*============================================<仓库记录类实现>============================================*/
StoreRecord::StoreRecord(const int& recordId, const int& partId,const myTime_t& operationTime,const QString& status) :
    recordId(recordId), partId(partId), operationTime(operationTime), status(status) {}

StoreRecord::StoreRecord(const int &partId, const myTime_t &operationTime, const QString &status) :
    partId(partId), operationTime(operationTime), status(status) {}

StoreRecord::~StoreRecord() {}

int StoreRecord::getrecordId()const { return recordId; }
int StoreRecord::getPartId()const { return this->partId; }
myTime_t StoreRecord::getOperationTime()const { return this->operationTime; }
QString StoreRecord::getStatus()const { return this->status; }


/*============================================<仓库入库记录类实现>============================================*/
StoreInRecord::StoreInRecord(const int& recordId, const int& partId, const myTime_t& operationTime, const QString& status, const int& inQuantity) :
    StoreRecord(recordId, partId, operationTime, status), inQuantity(inQuantity) {}
StoreInRecord::StoreInRecord(const StoreRecord& sr, const int& inQuantity) : StoreRecord(sr), inQuantity(inQuantity) {}

StoreInRecord::StoreInRecord(const int &partId, const myTime_t &operationTime, const QString &status, const int &inQuantity):
    StoreRecord(partId, operationTime, status), inQuantity(inQuantity) {}

StoreInRecord::~StoreInRecord() {}

int StoreInRecord::getInQuantity()const { return this->inQuantity; }




/*============================================<仓库出库记录类实现>============================================*/
StoreOutRecord::StoreOutRecord(const StoreRecord& sr, const int& outQuantity) :StoreRecord(sr), outQuantity(outQuantity) {}
StoreOutRecord::StoreOutRecord(const int& recordId, const int& partId, const myTime_t& operationTime, const QString& status, const int& outQuantity) :
    StoreRecord(recordId, partId, operationTime, status), outQuantity(outQuantity) {}

StoreOutRecord::StoreOutRecord(const int &partId, const myTime_t &operationTime, const QString &status, const int &outQuantity) :
    StoreRecord(partId, operationTime, status), outQuantity(outQuantity) {}

StoreOutRecord::~StoreOutRecord() {}

int StoreOutRecord::getOutQuantity()const { return this->outQuantity; }


/*============================================<仓库异常库记录类实现>============================================*/

StoreAnomaly::StoreAnomaly(const int& anomalyId, const int& partId, const int& actualQuantity, const int& systemQuantity, const QString& difference, const QString& confirmStatus) :
    anomalyId(anomalyId), partId(partId), actualQuantity(actualQuantity), systemQuantity(systemQuantity), difference(difference), confirmStatus(confirmStatus) {
}

StoreAnomaly::StoreAnomaly(const int& anomalyId, const int& partId, const QString& location, const int& actualQuantity, const int& systemQuantity, const QString& difference, const QString& confirmStatus) :
    anomalyId(anomalyId), partId(partId), location(location), actualQuantity(actualQuantity), systemQuantity(systemQuantity), difference(difference), confirmStatus(confirmStatus) {
}

StoreAnomaly::~StoreAnomaly() {}


int StoreAnomaly::getAnomalyId()const { return this->anomalyId; }
int StoreAnomaly::getPartId()const { return this->partId; }
QString StoreAnomaly::getLocation()const { return this->location; }
int StoreAnomaly::getActualQuantity()const { return this->actualQuantity; }
int StoreAnomaly::getSystemQuantity()const { return this->systemQuantity; }
QString StoreAnomaly::getDifference()const { return this->difference; }
QString StoreAnomaly::getConfirmStatus()const { return this->confirmStatus; }

void StoreAnomaly::setAnomalyId(int anomalyId) {this->anomalyId = anomalyId;}
void StoreAnomaly::setDifference(QString difference){this->difference = difference;}
void StoreAnomaly::setConfirmStatus(QString confirmStatus) { this->confirmStatus = confirmStatus; }


/*============================================<日志类实现>============================================*/

LogEntry::LogEntry(const myTime_t& operationTime, const QString& operatorName, const Role& operatorRole, const QString& operationDescribe) :
    operationTime(operationTime), operatorName(operatorName),operatorRole(operatorRole) ,operationDescribe(operationDescribe) {}
LogEntry::~LogEntry() {}

int LogEntry::getLogId()const { return this->logId; }
myTime_t LogEntry::getOperationTime()const { return this->operationTime; }
QString LogEntry::getOperatorName()const { return this->operatorName; }
Role LogEntry::getOperatorRole()const { return this->operatorRole; }
QString LogEntry::getOperationDescribe()const { return this->operationDescribe; }

